function Person(name, age) {
    this.name = name
    this.age = age
}

Person.prototype.say = function() {
    console.log('hello world')
}

function Child(name, age) {
    Person.call(this, name, age)
    console.log(this)
}

Child.prototype = new Person()

let c = new Child('zhangsan', 20)
let p = new Person('lisi', 30)
console.log(c.name)
console.log(c.age)
c.name = 'haha'
console.log(c.name)
console.log(p.name)
console.log(p.age)